package com.example.springbootapplication.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * 定义监听{@link ContextRefreshedEvent}事件
 * @Author acy
 * @Date 2019/04/27
 */
@Order(Ordered.HIGHEST_PRECEDENCE)
public class HelloWorldApplicationListener implements ApplicationListener<ContextRefreshedEvent> {
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		System.out.println("hello world 自定义监听"+event.getApplicationContext().getId()+"时间---"+event.getTimestamp());
	}
}
